Skip to content

refactor(cli): unify naming for credentials, confirmation flags, and dry-run flags#702

Closed
jesseturner21 wants to merge 4 commits intomainfrom
refactor/unify-cli-naming
Closed

refactor(cli): unify naming for credentials, confirmation flags, and dry-run flags#702
jesseturner21 wants to merge 4 commits intomainfrom
refactor/unify-cli-naming

Conversation

@jesseturner21
Copy link
Copy Markdown
Contributor

Summary

  • Unify identity/credential naming: Renamed CLI command add identityadd credential, resource type, labels, validation, and docs. Old identity command preserved as hidden alias for backward compat.
  • Standardize confirmation skip flags: remove commands now use -y, --yes (matching deploy). --force preserved as alias for backward compat.
  • Standardize dry-run flags: deploy now uses --dry-run as primary flag (matching create and remove all). --plan preserved as alias for backward compat.

Each change is a separate commit for clean review.

Testing

  • All 3076 unit tests pass across 217 test files (npm test)
  • TypeScript build succeeds cleanly (npm run build)
  • ESLint + Prettier pass via pre-commit hooks on all 3 commits
  • Built and packed CLI from source, installed locally via npm install <tarball>
  • Verified CLI help output reflects new command names:
    • npx agentcore add --help shows credential (not identity)
    • npx agentcore deploy --help shows --dry-run as primary, --plan as alias
    • npx agentcore remove --help shows -y, --yes as primary, --force as alias
  • Verified backward compatibility:
    • npx agentcore add identity --help still works (alias)
    • npx agentcore remove agent --force still works (alias for --yes)
    • npx agentcore deploy --plan still works (alias for --dry-run)

Test plan

  • npm test — all 3076 tests pass
  • npm run build — clean build
  • Pre-commit hooks (eslint, prettier, secretlint, typecheck) pass on all commits
  • CLI help text reflects updated flag names
  • Backward-compatible aliases work for identity, --force, --plan

The CLI command was 'add identity', the config key was 'credentials',
and the resource types were ApiKeyCredentialProvider / OAuthCredentialProvider.
Three different names for the same concept. This unifies everything under
'credential' — CLI commands, resource type, labels, validation, and docs.

The old 'identity' command name is preserved as a hidden alias for
backward compatibility.

Constraint: Must maintain backward compat for existing scripts using 'agentcore add identity'
Rejected: Keep 'identity' as primary | 'credential' is already the config term and more precise
Confidence: high
Scope-risk: moderate
deploy uses -y, --yes while remove uses --force. These mean the same
thing (skip interactive confirmation) but used different names.

Now -y/--yes is the primary flag everywhere. --force is preserved as
an alias on remove commands for backward compatibility.

Constraint: Must not break existing scripts using --force on remove
Rejected: Use --force everywhere | --yes is the conventional flag name for confirmation skip
Confidence: high
Scope-risk: narrow
deploy uses --plan while create and remove use --dry-run. Same concept,
different names. Now --dry-run is the primary flag on deploy. --plan is
preserved as an alias for backward compatibility.

Output message updated from 'Plan complete' to 'Dry run complete'.

Constraint: Must not break existing scripts using --plan on deploy
Rejected: Use --plan everywhere | --dry-run is the standard convention
Confidence: high
Scope-risk: narrow
@jesseturner21 jesseturner21 requested a review from a team March 27, 2026 16:08
@github-actions github-actions Bot added the size/m PR size: M label Mar 27, 2026
The article was 'an' for the old 'identity' label but 'credential'
takes 'a'. This fixes help text like "Remove an credential" → "Remove a credential".

Confidence: high
Scope-risk: narrow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/m PR size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant